﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="get_test_detail.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Certificate.get_test_detail" %>

<%@ Import Namespace="DataAccess" %>
<%@ Import Namespace="System.Linq" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<body>
    <%
        int id = int.Parse(Request.QueryString["id"]);
        var get_td = new TblTestDetailController().FetchAll().Where(x => x.TestId == id).ToList();
    %>
    <div id="get_id" class="w3-hide"><%=id %></div>
    <ul class="user-option-tab w3-navbar w3-border-bottom w3-border-teal">
        <li><a href="javascript:;" class="tablink w3-hover-teal w3-teal" onclick="open_question_type(event, 'loai1');">Từ vựng</a></li>
        <li><a href="javascript:;" class="tablink w3-hover-teal" onclick="open_question_type(event, 'loai2');">Ngữ Pháp</a></li>
        <li><a href="javascript:;" class="tablink w3-hover-teal" onclick="open_question_type(event, 'loai3');">Nghe</a></li>
        <li><a href="javascript:;" class="tablink w3-hover-teal" onclick="open_question_type(event, 'loai4');">Hán tự</a></li>
    </ul>
    <div id="loai1" class="city w3-border w3-border-teal">
        <ul class="w3-ul w3-white w3-hoverable test_detail">
            <%
                for (int i = 1; i <= get_td.Count; i++)
                {
                    if (get_td[i - 1].TestDetailType != 1)
                    {
                        continue;
                    }
            %>
            <li id="<%=get_td[i-1].TestDetailId %>" class="question w3-display-container w3-padding">
                <div class="ques_id w3-hide"><%=get_td[i-1].TestDetailId %></div>
                <div class="w3-row">
                    <label class="w3-border-teal" style="border-bottom: 3px solid">Câu&nbsp;<span class="thutu"><%=i %></span>:</label>&nbsp;<%=get_td[i-1].TestDetailQuestion %><br />
                    <%if (get_td[i - 1].TestDetailUrl != "")
                      {%>
                    <% string[] temp = new string[20];

                       temp = get_td[i - 1].TestDetailUrl.ToLower().Split('.');
                       string tail = temp[temp.Length - 1];
                       if (tail == "mp3" || tail == "wav")
                       {
                    %>
                    <p>
                        <audio src="../Content/Testdata/Audio/<%=get_td[i-1].TestDetailUrl %>" controls="controls" />
                    </p>
                    <%
                   }
                   else
                   {
                    %>
                    <p>
                        <img src="../Content/TestData/picture/<%=get_td[i-1].TestDetailUrl %>" width="30%" />
                    </p>
                    <%
                   }
                  } %>
                </div>
                <span class="del_modal w3-closebtn w3-display-topright w3-padding-right">&times;</span>
            </li>
            <%} %>
        </ul>
    </div>
    <div id="loai2" class="city w3-border w3-border-teal" style="display: none">
        <ul class="w3-ul w3-white w3-hoverable test_detail">
            <%
                for (int i = 1; i <= get_td.Count; i++)
                {
                    if (get_td[i - 1].TestDetailType != 2)
                    {
                        continue;
                    }
            %>
            <li id="<%=get_td[i-1].TestDetailId %>" class="question w3-display-container w3-padding">
                <div class="ques_id w3-hide"><%=get_td[i-1].TestDetailId %></div>
                <div class="w3-row">
                    <label class="w3-border-teal" style="border-bottom: 3px solid">Câu&nbsp;<span class="thutu"><%=i %></span>:</label>&nbsp;<%=get_td[i-1].TestDetailQuestion %><br />
                    <%if (get_td[i - 1].TestDetailUrl != "")
                      {%>
                    <% string[] temp = new string[20];

                       temp = get_td[i - 1].TestDetailUrl.ToLower().Split('.');
                       string tail = temp[temp.Length - 1];
                       if (tail == "mp3" || tail == "wav")
                       {
                    %>
                    <p>
                        <audio src="../Content/Testdata/Audio/<%=get_td[i-1].TestDetailUrl %>" controls="controls" />
                    </p>
                    <%
                   }
                   else
                   {
                    %>
                    <p>
                        <img src="../Content/TestData/picture/<%=get_td[i-1].TestDetailUrl %>" width="30%" />
                    </p>
                    <%
                   }
                  } %>
                </div>
                <span class="del_modal w3-closebtn w3-display-topright w3-padding-right">&times;</span>
            </li>
            <%} %>
        </ul>
    </div>
    <div id="loai3" class="city w3-border w3-border-teal" style="display: none">
        <ul class="w3-ul w3-white w3-hoverable test_detail">
            <%
                for (int i = 1; i <= get_td.Count; i++)
                {
                    if (get_td[i - 1].TestDetailType != 3)
                    {
                        continue;
                    }
            %>
            <li id="<%=get_td[i-1].TestDetailId %>" class="question w3-display-container w3-padding">
                <div class="ques_id w3-hide"><%=get_td[i-1].TestDetailId %></div>
                <div class="w3-row">
                    <label class="w3-border-teal" style="border-bottom: 3px solid">Câu&nbsp;<span class="thutu"><%=i %></span>:</label>&nbsp;<%=get_td[i-1].TestDetailQuestion %><br />
                    <%if (get_td[i - 1].TestDetailUrl != "")
                      {%>
                    <% string[] temp = new string[20];

                       temp = get_td[i - 1].TestDetailUrl.ToLower().Split('.');
                       string tail = temp[temp.Length - 1];
                       if (tail == "mp3" || tail == "wav")
                       {
                    %>
                    <p>
                        <audio src="../Content/Testdata/Audio/<%=get_td[i-1].TestDetailUrl %>" controls="controls" />
                    </p>
                    <%
                   }
                   else
                   {
                    %>
                    <p>
                        <img src="../Content/TestData/picture/<%=get_td[i-1].TestDetailUrl %>" width="30%" />
                    </p>
                    <%
                   }
                  } %>
                </div>
                <span class="del_modal w3-closebtn w3-display-topright w3-padding-right">&times;</span>
            </li>
            <%} %>
        </ul>
    </div>
    <div id="loai4" class="city w3-border w3-border-teal" style="display: none">
        <ul class="w3-ul w3-white w3-hoverable test_detail">
            <%
                for (int i = 1; i <= get_td.Count; i++)
                {
                    if (get_td[i - 1].TestDetailType != 4)
                    {
                        continue;
                    }
            %>
            <li id="<%=get_td[i-1].TestDetailId %>" class="question w3-display-container w3-padding">
                <div class="ques_id w3-hide"><%=get_td[i-1].TestDetailId %></div>
                <div class="w3-row">
                    <label class="w3-border-teal" style="border-bottom: 3px solid">Câu&nbsp;<span class="thutu"><%=i %></span>:</label>&nbsp;<%=get_td[i-1].TestDetailQuestion %><br />
                    <%if (get_td[i - 1].TestDetailUrl != "")
                      {%>
                    <% string[] temp = new string[20];

                       temp = get_td[i - 1].TestDetailUrl.ToLower().Split('.');
                       string tail = temp[temp.Length - 1];
                       if (tail == "mp3" || tail == "wav")
                       {
                    %>
                    <p>
                        <audio src="../Content/Testdata/Audio/<%=get_td[i-1].TestDetailUrl %>" controls="controls" />
                    </p>
                    <%
                   }
                   else
                   {
                    %>
                    <p>
                        <img src="../Content/TestData/picture/<%=get_td[i-1].TestDetailUrl %>" width="30%" />
                    </p>
                    <%
                   }
                  } %>
                </div>
                <span class="del_modal w3-closebtn w3-display-topright w3-padding-right">&times;</span>
            </li>
            <%} %>
        </ul>
    </div>
</body>
</html>
